package com.bone.modules.quartz.job;

import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * @author : WangKeKe
 * @date : 2020/8/18 10:12
 * Description : 带参数的定时任务模板
 */

@Slf4j
public class SimpleParamJob implements Job {

    /**
     * 若参数变量名修改 QuartzController中也需对应修改
     */
    private String parameter;

    public void setParameter(String parameter) {
        this.parameter = parameter;
    }

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {

        log.info(String.format("%s 带参数定时任务 SampleParamJob !  时间:" + DateUtil.now(), this.parameter));

    }
}
